import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *

from ui.Ui_my_main_window import Ui_MainWindow
class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.ui = Ui_MainWindow()
        #加载Ui内容
        self.ui.setupUi(self)
        self.init_ui()
        
    @pyqtSlot()#解决按钮多次触发
    def on_btn_connect_clicked(self):
        print("连接")
        
    def init_ui(self):
        pass
        # self.ui.btn_connect.clicked.connect(self.on_btn_connect_clicked)
        
if __name__ == '__main__':
    app = QApplication(sys.argv)
    mywindow = MainWindow()
    mywindow.show()
    sys.exit(app.exec_())